<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('银河票务用户订单列表')" />
	<th:block th:include="include :: select2-css" />
</head>
<body class="gray-bg">
	<div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="data-form">
					<div class="select-list">
						<ul>
							<li>
								用户账号：<select id="userId" name="userId" class="form-control">
								<option th:each="user : ${userList}" th:text="${user['userAccount']}" th:value="${user['userId']}" th:field="*{user.userId}"></option>
							</select>
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
	        <div class="col-sm-12 select-table table-striped">
			    <table id="bootstrap-table"></table>
			</div>
		</div>
	</div>
	<th:block th:include="include :: footer" />
	<th:block th:include="include :: select2-js" />
	<script th:inline="javascript">
		var prefix = ctx + "galaxy/order";

		$(function() {
			var options = {
				url: prefix + "/list",
				modalName: "订单列表",
				columns: [{
						checkbox: true
					},
					{
						field: 'orderEvent.projectName',
						title: '项目名称'
					},
					{
						field: 'orderEvent.siteName',
						title: '站点'
					},
					{
						field: 'orderEvent.eventTime',
						title: '事件时间',
						sortable: true
					},
					{
						field: 'orderToken',
						title: '订单编号',
						sortable: true
					},
					{
						field: 'orderMoney',
						title: '订单价格',
						sortable: true
					},
					{
						field: 'orderItemsCount',
						title: '订单商品数量',
						sortable: true
					},
					{
						field: 'orderTime',
						title: '订单时间',
						sortable: true
					},
					{
						field: 'orderFailureTime',
						title: '订单失败时间',
						sortable: true
					},
					{
						field: 'orderPayState',
						title: '订单支付状态',
						align: 'center',
					},
					{
						title: '操作',
						align: 'center',
						formatter: function(value, row, index) {
							var actions = [];
							// actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.dictCode + '\')"><i class="fa fa-edit"></i>编辑</a> ');
							// actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.dictCode + '\')"><i class="fa fa-remove"></i>删除</a>');
							return actions.join('');
						}
					}]
				};
			$.table.init(options);
		});
	</script>
</body>
</html>